{include file='md/md_header.html'}
<div class="top-menu">
    <ul class="nav nav-pills">
        {if !session('user'):}
        <li><a href="{:url('login/login')}">管理</a></li>
        {else:}
        <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                管理 <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
                <li><a href="{:url('md/edit',['id'=>$vo['id']])}">编辑</a></li>
                <li><a href="{:url('md/add',['doc_id'=>$doc_id])}">新增</a></li>
                <li><a href="javascript:ajaxConfirm('{:url('md/del',['id'=>$vo['id']])}','删除',1);">删除</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="javascript:ajaxConfirm('{:url('login/logout')}','退出',2);">退出</a></li>
            </ul>
        </li>
        {/if}
        <li><a href="{:url('md/down',['id'=>$vo['id']])}">下载</a></li>
        <li><a href="{:url('index/index')}">首页</a></li>
    </ul>
</div>
<div class="content">
    <div id="content-editormd" class="markdown">
        <textarea id="markdown" name="markdown" style="display:none;">{$vo.markdown}</textarea>
    </div>
    <div class="alert text-right text-success">更新于{$vo.update_time|get_time_ago}</div>
</div>
{include file='md/md_footer.html'}
<script src="__STATIC__/js/editor_md/lib/marked.min.js"></script>
<script src="__STATIC__/js/editor_md/lib/prettify.min.js"></script>
<script src="__STATIC__/js/editor_md/lib/raphael.min.js"></script>
<script src="__STATIC__/js/editor_md/lib/underscore.min.js"></script>
<script src="__STATIC__/js/editor_md/lib/sequence-diagram.min.js"></script>
<script src="__STATIC__/js/editor_md/lib/flowchart.min.js"></script>
<script src="__STATIC__/js/editor_md/lib/jquery.flowchart.min.js"></script>
<script>
    $(function () {
        $('#sidebarToggle').click(function () {
            $('.sidebar').toggle();
        });
        editormd.markdownToHTML("content-editormd", {
            htmlDecode: "style,script,iframe",
            emoji: true,
            taskList: true,
            tex: true,
            flowChart: true,
            sequenceDiagram: true,
            codeFold: true
        });
    });
</script>
</body>
</html>